<?php

/**
 * TaxiOrder form base class.
 *
 * @package    form
 * @subpackage taxi_order
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $
 */
class BaseTaxiOrderForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                   => new sfWidgetFormInputHidden(),
      'created_at'           => new sfWidgetFormDateTime(),
      'date'                 => new sfWidgetFormDate(),
      'time'                 => new sfWidgetFormTime(),
      'name'                 => new sfWidgetFormInput(),
      'contact_number'       => new sfWidgetFormInput(),
      'pickup_address'       => new sfWidgetFormInput(),
      'destination_address'  => new sfWidgetFormInput(),
      'number_of_passengers' => new sfWidgetFormInput(),
      'number_of_luggage'    => new sfWidgetFormInput(),
      'vehicle_type'         => new sfWidgetFormInput(),
      'comment'              => new sfWidgetFormTextarea(),
      'cost'                 => new sfWidgetFormInput(),
      'driver_id'            => new sfWidgetFormPropelSelect(array('model' => 'TaxiDriver', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'                   => new sfValidatorPropelChoice(array('model' => 'TaxiOrder', 'column' => 'id', 'required' => false)),
      'created_at'           => new sfValidatorDateTime(array('required' => false)),
      'date'                 => new sfValidatorDate(),
      'time'                 => new sfValidatorTime(),
      'name'                 => new sfValidatorString(array('max_length' => 100)),
      'contact_number'       => new sfValidatorString(array('max_length' => 100)),
      'pickup_address'       => new sfValidatorString(array('max_length' => 200)),
      'destination_address'  => new sfValidatorString(array('max_length' => 200)),
      'number_of_passengers' => new sfValidatorInteger(),
      'number_of_luggage'    => new sfValidatorInteger(),
      'vehicle_type'         => new sfValidatorString(array('max_length' => 100)),
      'comment'              => new sfValidatorString(),
      'cost'                 => new sfValidatorNumber(),
      'driver_id'            => new sfValidatorPropelChoice(array('model' => 'TaxiDriver', 'column' => 'id')),
    ));

    $this->widgetSchema->setNameFormat('taxi_order[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'TaxiOrder';
  }


}
